﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using ITSSP.Web.Models;

namespace ITSSP.Views.UserList
{
	public partial class EditUserWindow : ChildWindow
	{
		public User User { get; private set; }

		public EditUserWindow(User editUser)
		{
			InitializeComponent();

			this.User = editUser;
			this.dataForm1.CurrentItem = this.User;
			this.dataForm1.BeginEdit();
		}

		private void OKButton_Click(object sender, RoutedEventArgs e)
		{
			if (this.dataForm1.CommitEdit())
			{
				this.DialogResult = true;
			}
		}

		private void CancelButton_Click(object sender, RoutedEventArgs e)
		{
			this.dataForm1.CancelEdit();
			this.DialogResult = false;
		}
	}
}

